package com.gzdh.tang.modu.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gzdh.tang.comm.vo.Result;
import com.gzdh.tang.modu.entity.Fk;
import com.gzdh.tang.modu.entity.MacMainpSbruanDinner;
import com.gzdh.tang.modu.service.FkService;
import com.gzdh.tang.modu.service.MacMainpSbruanDinnerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("api/AliFace/sys")
public class ALiSystemController {

    @Autowired
    FkService fkService;

    @Autowired
    MacMainpSbruanDinnerService macMainpSbruanDinnerService;

    @GetMapping("downFk")
    public Result<Object> downFk(@RequestParam("time") String time) {
        Result<Object> result = new Result<>();
        List<Fk> fkList = fkService.list(new QueryWrapper<Fk>().lambda().ge(Fk::getFkrq, time));
        result.setResult(fkList);
        return result;
    }


    @GetMapping("downMainpSbruanDinner")
    public Result<Object> downMainpSbruanDinner() {
        Result<Object> result = new Result<>();
        List<MacMainpSbruanDinner> macMainpSbruanDinnerList = macMainpSbruanDinnerService.list();
        result.setResult(macMainpSbruanDinnerList);
        return result;
    }
}
